package com.sahyadri.web.bean;

import java.io.Serializable;
import java.util.List;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import org.codehaus.jackson.annotate.JsonIgnore;

@Entity
@Table(name = "LOCATION")
public class Location implements Serializable  {

	private static final long serialVersionUID = 455433523255906156L;
	
	@Id
	@GeneratedValue
	private long id;
	private String name;
	private String displayName;
	private boolean active;
	private String url;
	private String emailId;
	private String phoneNumber;
	private Address address;
	@Column(length=1000) 
	private String embedString;
	
	
	
	@OneToMany(fetch = FetchType.LAZY)
	@JoinColumn(name="location_Id")
	@JsonIgnore
	private List<OperationHours> operationHours;
	
	@OneToMany(fetch = FetchType.LAZY)
	@JoinColumn(name="location_Id")
	@JsonIgnore
	private List<Category> categories;
	
	@OneToMany(fetch = FetchType.LAZY)
	@JoinColumn(name="location_Id")
	@JsonIgnore
	private List<Review> reviews;
	
	@OneToMany(fetch = FetchType.LAZY)
	@JoinColumn(name="location_Id")
	@JsonIgnore
	private List<Events> events;
	
	@OneToMany(fetch = FetchType.LAZY)
	@JoinColumn(name="location_Id")
	@JsonIgnore
	private List<Offer> offers;
	
	@OneToMany(fetch = FetchType.LAZY)
	@JoinColumn(name="location_Id")
	@JsonIgnore
	private Set<Menu> menus;
	
	@OneToMany(fetch = FetchType.LAZY)
	@JoinColumn(name="location_Id")
	@JsonIgnore
	private Set<GalleryDetails> galleryDetails;
	
	public String getUrl() {
		return url;
	}
	public void setUrl(String url) {
		this.url = url;
	}
	
	public long getId() {
		return id;
	}
	public void setId(long id) {
		this.id = id;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getDisplayName() {
		return displayName;
	}
	public void setDisplayName(String displayName) {
		this.displayName = displayName;
	}
	public boolean isActive() {
		return active;
	}
	public void setActive(boolean active) {
		this.active = active;
	}
	public Address getAddress() {
		return address;
	}
	
	
	
	
	
	public void setAddress(Address address) {
		this.address = address;
	}
	
	public List<OperationHours> getOperationHours() {
		return operationHours;
	}
	
	
	public void setOperationHours(List<OperationHours> operationHours) {
		this.operationHours = operationHours;
	}
	public List<Category> getCategories() {
		return categories;
	}
	
	
	public void setCategories(List<Category> categories) {
		this.categories = categories;
	}

	public List<Review> getReviews() {
		return reviews;
	}
	
	
	public void setReviews(List<Review> reviews) {
		this.reviews = reviews;
	}
	
	public List<Events> getEvents() {
		return events;
	}
	
	
	public void setEvents(List<Events> events) {
		this.events = events;
	}
	public List<Offer> getOffers() {
		return offers;
	}
	
	public void setOffers(List<Offer> offers) {
		this.offers = offers;
	}
	
	
	
	
	public Set<Menu> getMenus() {
		return menus;
	}
	public void setMenus(Set<Menu> menus) {
		this.menus = menus;
	}
	public String getEmailId() {
		return emailId;
	}
	public void setEmailId(String emailId) {
		this.emailId = emailId;
	}
	public String getPhoneNumber() {
		return phoneNumber;
	}
	public void setPhoneNumber(String phoneNumber) {
		this.phoneNumber = phoneNumber;
	}
	
	
	
	public Set<GalleryDetails> getGalleryDetails() {
		return galleryDetails;
	}
	public void setGalleryDetails(Set<GalleryDetails> galleryDetails) {
		this.galleryDetails = galleryDetails;
	}
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + (int) (id ^ (id >>> 32));
		return result;
	}
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Location other = (Location) obj;
		if (id != other.id)
			return false;
		return true;
	}
	public String getEmbedString() {
		return embedString;
	}
	public void setEmbedString(String embedString) {
		this.embedString = embedString;
	}
	
	
	
	
	
	
}
